游游的重组偶数
import java.util.Scanner;

 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        while (a--  0) {  注意 while 处理多个 case
            char[] arr = in.next().toCharArray();
            int len = arr.length;
            int i;
            for (i = len - 1; i = 0; i--) {
                if ((arr[i] - '0') % 2 == 0) {
                    char c = arr[len - 1];
                    arr[len - 1] = arr[i];
                    arr[i] = c;
                    break;
                }
            }
            StringBuilder str = new StringBuilder();
            
            if (i  0) {
                System.out.println(-1);
            } else {
                for (i = 0; i  len; i++) {
                    str.append(arr[i]);
                }
                System.out.println(str.toString());
            }
        }
    }
}